package com.uchedao.seller.widget.dialog;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.View;

import com.uchedao.seller.R;
import com.uchedao.seller.http.entity.BidPriceEntity;
import com.uchedao.seller.util.Arith;

/**
 * 查看出价确定成交弹框
 * Created by hang on 2015/10/29.
 */
public class ComfirmBidDialog extends CommonDialog implements View.OnClickListener {

    public BidPriceEntity data;

    public ComfirmBidDialog(Context context) {
        super(context, R.layout.dlg_comfirm_bid);
    }

    @SuppressLint("StringFormatMatches")
    @Override
    public void initDlgView() {
        setText(R.id.tvBidItemPrice, context.getString(R.string.bid_price, Arith.div(data.getPrice(), 10000) + ""));
        setText(R.id.tvBidItemCity, data.getProvince_caption() + data.getCity_caption());
        setText(R.id.tvBidItemNum, context.getString(R.string.bid_num, data.getMax_demand() + "", data.getAll_bid_num() + ""));

        getView(R.id.btnDlgOK).setOnClickListener(this);
        getView(R.id.btnDlgCancel).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch(view.getId()) {
            case R.id.btnDlgOK:
                dismiss();
                break;

            case R.id.btnDlgCancel:
                dismiss();
                break;
        }
    }
}
